<template>
  <div :class="{'inline':inline}">
    <span v-if="this.label">{{this.label}}</span>
    <input
      :type="type"
      :value="value"
      @input="$emit('input',$event.target.value)"
      :placeholder="placeholder"
    />
  </div>
</template>
<script>
/**
*引入组件
*注册组件
*template:
*		<my-input label="姓名" v-model="user" placeholder="username" @input="input"/>
*js:
*		input(value){
*     		console.log(value);
*   	}
*/
export default {
	props: {
		label: String,
		value: String,
		placeholder: String,
		type: {
			type: String,
			default: 'text'
		},
		inline: {
			type: Boolean,
			default: false
		}
	}
};
</script>
<style scoped>
.inline {
  display: inline;
}
span {
  margin-right: 10px;
}
</style>
